<%@page import="tianqi.entity.UserY"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	System.out.println("basePath: "+basePath);
	
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>添加购物车</title>
    <link rel="stylesheet" type="text/css" href="css/orderConfirm.css">
    <script type="text/javascript" charset="utf-8" src="js/jquery-1.11.3.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/distpicker.data.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/distpicker.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/main.js"></script>
	
</head>
<body>
	<div id="header" class="clear logo_top">
    <a href="${pageContext.request.contextPath}/youge.tq" class="lf"><img src="img/logo_tj.jpg" alt="购物车"/></a>
    <a href="${pageContext.request.contextPath}/youge.tq" class="rt"><img src="img/TJ.png" alt="购物车"/></a>
</div>
<div id="section">
	<form id="form1" action="" method="post">
		
	
    <div id="addrList">

        <p class="titleAddr">确认收货地址<span><a>(管理收货地址)</a></span></p>
        <input type="hidden" id="prdtotalprice" name="orderMoney" value="${bDecimal }">
		<c:forEach items="${addrs}" var="addr">
			 <p id="addrP">
			 
            <input data="address" name="address" type="radio" id="198953" class="address" <c:if test="${addr.isdefault==1 }">checked='checked'</c:if> value="${addr.username }">
            <span id="getproAddr" > ${addr.economize }  ${addr.city }  ${addr.county }  ${addr.addrdetail }</span>
            <span id="getproUname"> ${addr.username }</span>
             <c:choose>
   				<c:when test="${addr.isdefault==1 }"> 
   				 <input type="hidden" name="getproAddr" value=" ${addr.economize }  ${addr.city }  ${addr.county }  ${addr.addrdetail }" />
   				 <input type="hidden" id="getproUname6" name="getproUname" value=" ${addr.username }" />
   				</c:when>
			</c:choose>
        </p>
		</c:forEach>
       
        

        <div class="dizhi_k" id="dizhi"><img src="img/edit.png" alt="" width="23px" height="23px"/><a style="cursor:pointer; font-size: 16px;">使用新地址</a></div>

        <div id="addfrm" style="display: none;">
            <form id="form2" method="post" action="" target="_self">
                <div class="tianxie_dz">
                    <span><img src="./订单确认-优个网_files/biaoshi_x.jpg">收货人：</span>
                    <div><input name="username" id="add_username" type="text" class="text"></div>
                </div>

                <div class="tianxie_dz">
                    <span><img src="./订单确认-优个网_files/biaoshi_x.jpg">所在地区：</span>
                    <div id="das" data-toggle="distpicker">
                        <select name="economize" class="country" id="country">
                            <option value="0" selected="selected">请选择</option><option value="10111">北京市</option><option value="10112">天津市</option><option value="10113">河北省</option><option value="10114">山西省</option><option value="10115">内蒙古自治区</option><option value="10121">辽宁省</option><option value="10122">吉林省</option><option value="10123">黑龙江省</option><option value="10131">上海市</option><option value="10132">江苏省</option><option value="10133">浙江省</option><option value="10134">安徽省</option><option value="10135">福建省</option><option value="10136">江西省</option><option value="10137">山东省</option><option value="10141">河南省</option><option value="10142">湖北省</option><option value="10143">湖南省</option><option value="10144">广东省</option><option value="10145">广西壮族自治区</option><option value="10146">海南省</option><option value="10150">重庆市</option><option value="10151">四川省</option><option value="10152">贵州省</option><option value="10153">云南省</option><option value="10154">西藏自治区</option><option value="10161">陕西省</option><option value="10162">甘肃省</option><option value="10163">青海省</option><option value="10164">宁夏回族自治区</option><option value="10165">新疆维吾尔自治区</option><option value="10171">台湾省</option><option value="10181">香港特别行政区</option><option value="10182">澳门特别行政区</option><option value="10183">国际地区</option>
                        </select>

                        <select name="city" class="province" id="province">
                            <option value="0">请选择</option>
                        </select>

                        <select name="county" class="region" id="region">
                            <option value="0">请选择</option>
                        </select>
                    </div>
                </div>

                <div class="tianxie_dz">
                    <span><img src="./订单确认-优个网_files/biaoshi_x.jpg">详细地址：</span>
                    <div><input name="addrdetail" id="add_address" type="text" class="text"></div>
                </div>

                <div class="tianxie_dz">
                    <span><img src="./订单确认-优个网_files/biaoshi_x.jpg">手机号码：</span>
                    <div><input name="phone" id="add_mobile" type="text" class="text" style="width:150px;"></div>
                </div>

                <div class="tianxie_dz">
                    <span>邮箱：</span>
                    <div><input name="mail" id="add_email" type="text" class="text" style="margin-right:10px;"></div>
                </div>
                <div class="tianxie_dz">
                    <span>设为默认：</span>
                    <p><input name="isdefault" type="radio" value="1" class="text" style="margin-right:10px;"> 是   <input name="isdefault" type="radio" class="text" value="0" style="margin-right:10px;"> 否</p>
                </div>

                <div class="queren_btn">
                    <input type="hidden" id="add_addressid" name="add_addressid" value="0">
                    <input type="hidden" id="uid" name="uid" value="16341752">
                    <input type="hidden" name="type" value="new_add">
                    <input type="submit" id="qr" onclick="form1Submit('${pageContext.request.contextPath}/saveAddr.tq');" value="确认"  style="background-color: #d51938;color: #ffffff;display: inline-block;font-size: 14px;height: 36px;line-height: 36px;text-align: center;text-decoration: none;width: 120px; border:none; cursor:pointer;"><input id="noadd" type="button" value="取消" style="margin-left:10px; cursor:pointer;background-color: #d51938;color: #ffffff;display: inline-block;font-size: 14px;height: 36px;line-height: 36px;text-align: center;text-decoration: none;width: 120px; border:none;" >
                </div>
            </form>
        </div>
    </div>
    <div id="pay" class="clear">
        <div class="zhifu">
            <p>付款、配送方式及其他<span><a>(管理付款、配送方式)</a></span></p>
            <div class="fangshi">
                <div class="mdmdzt" style="display:none;position: absolute;left: 78px;top: -15px;"><img src="./订单确认-优个网_files/mdzt.gif" title="本地区支持门店自提"></div>
                <div>
                    <span>支付方式<i><a style="cursor:pointer;" id="payment">[修改]</a></i></span>
                    <span class="payment_name">网上支付</span>
                    <span class="payment_txt" id="zt_payment_txt">亲爱的用户，优个网支持信用卡快捷支付 支付宝等安全支付方式，您在最后支付时可以自由选择 。</span>
                </div>
                <input type="hidden" value="1" name="pay_method" id="pay_method">

            </div>
        </div>

    </div>
    <div id="orderTQ">
        <table width="100%" border="0">
            <tbody><tr id="bai" class="bai">
                <td width="49%" align="center" bgcolor="#7e7c7a">商品信息</td>
                <td width="12%" align="center" bgcolor="#7e7c7a">规格</td>
                <td width="11%" align="center" bgcolor="#7e7c7a">服务要求</td>
                <td width="10%" align="center" bgcolor="#7e7c7a">原价（元）</td>
                <td width="10%" align="center" bgcolor="#7e7c7a">现价（元）</td>
                <td width="8%" align="center" bgcolor="#7e7c7a">数量</td>
            </tr>
            <c:forEach items="${queryCar}" var="l">
            	 <tr class="proTr" style="border: 1px solid #000;">
                <td class="proTd" bgcolor="#fffdee">
                    <div class="shangpin_xx">
                        <div class="shangpin_tu"> <a href="http://www.yoger.com.cn/product/199505.html" target="_blank"><img src="${l.detailImg }"></a>
                        </div>
                        <div class="shangpin_m"><a href="http://www.yoger.com.cn/product/199505.html">${l.pro.proCall }</a></div>
                    </div>
                </td>
                <td align="center" bgcolor="#fffdee">${l.spec }</td>
                <td align="center" bgcolor="#fffdee">/</td>
                <td align="center" bgcolor="#fffdee">${l.pro.ygPrice }</td>
                <td align="center" bgcolor="#fffdee" class="prdprice" id="1">${l.pro.ygPrice }</td>
                <td align="center" bgcolor="#fffdee">${l.num }</td>
            </tr>
            
            </c:forEach>
           
            
            <tr bgcolor="#fffdee" style="border:none; background:none; font-size:16px;">
                <td colspan="7" align="right" style="padding:10px 25px 10px 0;">
                    商品共计：<span style=" font-size:16px;">${proTotal }</span>件
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="zongji clear" id="zogji">
        <p><span>货品总金额: <b class="prdtotalprice">${bDecimal }</b>元</span><span>商品共计: <b style="color:#d51938;">${proTotal }</b>件</span></p>
        

        <p><span>应付总额（含运费）: <b style="color:#d51938; font-size:20px; font-weight:bold; font-family:Arial, Helvetica, sans-serif;" class="totalprice">${bDecimal }</b>元</span></p>
        <p>
            <a style="cursor:pointer;" href="javascript:form1Submit('${pageContext.request.contextPath}/orderSubmit.tq');">提交订单</a>
        </p>
    </div>
	</form>
</div>

</div>
<footer id="footer_top" class="clear">
    <div class="footer_top_sub">
        <div class="service_list clear">
            <dl>
                <dt><h3><a href="#">购物指南</a></h3></dt>
                <dd><a href="#">如何购买</a></dd>
                <dd><a href="#">会员介绍</a></dd>
                <dd><a href="#">会员积分</a></dd>
                <dd><a href="#">常见问题</a></dd>
                <dd><a href="#">帮助中心</a></dd>
                <dd><a href="#">购物须知</a></dd>
            </dl>
            <dl>
                <dt><h3><a href="#">配送方式</a></h3></dt>
                <dd><a href="#">上门自提</a></dd>
                <dd><a href="#">优个运动线下店</a></dd>
                <dd><a href="#">快递方式</a></dd>
                <dd><a href="#">满199免运费</a></dd>
                <dd><a href="#">验货签收</a></dd>
                <dd><a href="#">订单跟踪</a></dd>
            </dl>

            <dl>
                <dt><h3><a href="#">付款方式</a></h3></dt>
                <dd><a href="#">货到付款</a></dd>
                <dd><a href="#">在线支付</a></dd>
                <dd><a href="#">银行转账</a></dd>
                <dd><a href="#">邮局汇款</a></dd>

            </dl>

            <dl>
                <dt><h3><a href="#">售后服务</a></h3></dt>
                <dd><a href="#">售后服务政策</a></dd>
                <dd><a href="#">先行赔付/质保说明</a></dd>
                <dd><a href="#">返修/退货换货</a></dd>
                <dd><a href="#">联系客服</a></dd>
                <dd><a href="#">投诉建议</a></dd>
                <dd><a href="#">提问中心</a></dd>
            </dl>
            <dl>
                <dt><h3><a href="#">购物指南</a></h3></dt>
                <dd><a href="#">专业穿线</a></dd>
                <dd><a href="#">专业粘拍</a></dd>
                <dd><a href="#">装备修复</a></dd>
                <dd><a href="#">优个礼品卡</a></dd>
                <dd><a href="#">企业团购</a></dd>
                <dd><a href="#">多运动</a></dd>
            </dl>
        </div>
        <div class="footer_top_img">
            <img src="bg_img/images/youbiao1.jpg">
            <img src="bg_img/images/youbiao2.jpg">
            <img src="bg_img/images/youbiao3.jpg">
            <img src="bg_img/images/youbiao4.jpg">
            <img src="bg_img/images/youbiao5.jpg">
            <img src="bg_img/images/youbiao6.jpg">
        </div>
    </div>
</footer>
<footer id="footer_middle">
    <div>
        <a href="http://www.yoger.com.cn/">首页</a>|
        <a rel="nofollow" href="http://www.yoger.com.cn/about01.html">关于我们</a>|
        <a rel="nofollow" href="http://www.yoger.com.cn/about06.html">联系我们</a>|
        <a rel="nofollow" href="http://www.yoger.com.cn/zhaopin/">加入优个网</a>|
        <a href="http://www.yoger.com.cn/link.html">友情链接</a>|
        <!--<a href="http://www.yoger.com.cn/Sitemap.html">网站地图</a>|-->
        <!--<a href="#">网站联盟</a>|-->
        <a rel="nofollow" href="http://www.yoger.com.cn/union/schoolunion.html">校园代理</a>|
        <!--<a href="http://www.yoger.com.cn/union/campus.html">代理查询</a>|-->
        <a href="http://www.yoger.com.cn/app.html">手机优个</a>|
        <a href="http://www.yoger.com.cn/rexiaoxinghao.html">热销型号</a>|
        <a href="http://www.yoger.com.cn/chanpindaquan.html">商品大全</a>|
        <a href="http://www.yoger.com.cn/topic/">咨询主题</a>|
        <a href="http://www.yoger.com.cn/productTopic/">商品主题</a>|
        <a href="http://www.yoger.com.cn/Sitemap.html">网站地图</a>
    </div>
</footer>
<footer id="footer_bottom">
    <div>
        <p>Copyright® 优个网 Copyright© 2008-2016 北京优个网信息技术有限公司 版权所有 京ICP备05062157号 <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502008866" style="color:#333333">京公网安备 11010502008866号</a></p>
        <p><p>地址：北京市朝阳区北苑路金泉时代广场1座1501室<a style="color:#d51938; text-decoration:none;" href="http://www.yoger.com.cn/info-1134.html" target="_blank"> 乘车路线</a><span style="color:#d51938; font-weight:bold; margin-left:20px;">服务热线：400-0996-400&nbsp;&nbsp;售后专线：010-51261980&nbsp;&nbsp;遇忙请拨：010-56704431</span></p></p>
        <p>
            <img src="images/bomimg_tp30.jpg">
            <img src="images/bomimg_01.jpg">
            <img src="images/bomimg_02.jpg">
            <img src="images/bomimg_03.jpg">
            <img src="images/bottom_small_img.png">
        </p>
    </div>
</footer>
<script type="text/javascript" charset="utf-8">
		$('#das').distpicker();
		function checkStockAll(){
			var flag="";
			$.ajax({
			      type:"post",
			      url:"${pageContext.request.contextPath}/checkStockAll.tq",
			      async: false,
			      success:function(data){
			        console.log(data)
			        flag=data;
			      },
			      error:function(data){
			        alert("系统错误");
			        console.log(data);
			        return;
			      }
			    });
			return flag;
		}
		$("#dizhi").click(function(){
			alert("aaaaaaaa");
			$("#addfrm").css({
				display:"block"
			})
		})
		$("#noadd").click(function(){
			alert("dsfd");
			$("#addfrm").css({
				display:"none"
			})
		})
		function form1Submit(path){
			
			alert(path);
			$("#form1").attr({
				action:path
			})
			$("#form1").submit();
			
			
		}
		$("#addrList input[data='address']").each(function(){
				$(this).click(function(){
					alert("this::: "+$(this).val());
					$("#getproUname6").val("");
					$("#getproUname6").val($(this).val());
					alert("getproUname6::: "+$("#getproUname6").val());
				})
				
				
		});
		
		
		
		
		
	</script>

</body>
</html>